package com.sdx.console.meet.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.beetl.sql.core.annotatoin.ColumnIgnore;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.SeqID;
import org.apache.commons.lang3.StringUtils;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.sdx.service.ConfigService;

import org.beetl.sql.core.TailBean;
import java.math.*;

import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;

import org.beetl.sql.core.annotatoin.InsertIgnore;
import org.beetl.sql.core.annotatoin.Version;
import org.beetl.sql.core.annotatoin.LogicDelete;
import com.sdx.common.utils.Utils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/*
*
* gen by Spring Boot2 Admin 2019-03-25
*/
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
@Data
public class MeetRecord extends BaseEntity{

    //预约ID
    @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
    @AutoID
    private Long meetId ;

    //预约编号[用作订单编号]
    private String meetNo ;

    //约见主题
    private String meetTitle ;

    //约见附件
    private String meetFile ;

    //预约类型[0-免费  1-付费]
    private String meetType ;

    //预约状态[0-待预约  1-已预约   2-已服务  3-已取消]
    private Integer meetStatus ;

    //约见地址
    private String meetAddr ;

    //约见价格
    private BigDecimal meetPrice ;

    //学生问题
    private String studentQuestion ;

    //学生情况
    private String studentBrief ;

    //支付状态[0-待支付 1-已支付]
    private Integer payStatus ;

    //支付时间
    private Date payTime ;

    //服务态度[0-差  1-一般  2-良好 3-优秀]
    private String attitude ;

    //服务能力[5-4-3-2-1星]
    private String fwscore ;

    //服务评语
    private String comment ;

    //微信推送状态[0-待推送 1-已推送]
    private String wxpushStatus ;

    //定价服务ID
    private Long serviceId ;

    //来自预约用户ID
    private String fromCustomerid ;

    //咨询师用户ID
    private String toCustomerid ;

    //服务备注
    private String meetMemo ;

    //确定约见时间
    private Date meetTime ;

    //创建时间
    private Date createdTime ;

    //更新时间
    private Date updatedTime ;

    //服务状态 0 待服务 1 进行中 2 已完成 3 已取消
    private Integer serviceStatus;

    //归属
    @ColumnIgnore
    private Integer orgId ;

	@ColumnIgnore
	@JsonIgnore
	private String payTimeQuery;
	@ColumnIgnore
	@JsonIgnore
	private Date payTimeStart;
	@ColumnIgnore
	@JsonIgnore
	private Date payTimeEnd;

	public String getPayTimeQuery(){
		return  payTimeQuery;
	}
	public void setPayTimeQuery(String payTimeQuery ){
		this.payTimeQuery = payTimeQuery;
		Date[] timePair = Utils.parseQueryTime(payTimeQuery);
		if (timePair!=null && timePair[0]!=null) {
			this.payTimeStart = timePair[0];
		}
		if (timePair!=null && timePair.length==2 && timePair[1]!=null) {
			this.payTimeEnd = timePair[1];
		}

	}
	public Date getPayTimeStart(){
		return  payTimeStart;
	}
	public void setPayTimeStart(Date payTimeStart ){
		this.payTimeStart = payTimeStart;
	}
	public Date getPayTimeEnd(){
		return  payTimeEnd;
	}
	public void setPayTimeEnd(Date payTimeEnd ){
		this.payTimeEnd = payTimeEnd;
	}

    //预约类型名称
    @ColumnIgnore
    private  String teacherName;

    @ColumnIgnore
	private  String customerName;

    @ColumnIgnore
    private  String phone;

    private Date startTime;

    private Date endTime;

    private Integer provinceId;

    private String createdTimeQuery;

    public void setCreatedTimeQuery(String createdTimeQuery) {
        this.createdTimeQuery = createdTimeQuery;
        Date[] timePair = Utils.parseQueryTime(createdTimeQuery);
        if (timePair!=null && timePair[0]!=null) {
            this.startTime = timePair[0];
        }
        if (timePair!=null && timePair.length==2 && timePair[1]!=null) {
            this.endTime = timePair[1];
        }
    }
}
